package com.onetwork.core.ui.components.dialog.actions;

import com.onetwork.core.ui.components.dialog.listeners.DialogListener;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import javax.swing.KeyStroke;

public class LimparAction extends AbstractAction {
    private static final long serialVersionUID = 1L;
    private final DialogListener dialogListener;
    public LimparAction(DialogListener dialogListener) {
        super("Limpar", new ImageIcon(LimparAction.class.getResource("/imagens/refresh.png")));
        this.putValue(SHORT_DESCRIPTION, "Limpar tela");
        this.putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.ALT_MASK));
        this.putValue(MNEMONIC_KEY, new Integer(KeyEvent.VK_L));
        this.dialogListener = dialogListener;
   }

    public void actionPerformed(ActionEvent event) {
        this.dialogListener.dialogListenerLimpar();
    }    
}
